<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="theme-color" content="#222">

<script>
    (function(){
        if(''){
            if (prompt('请输入文章密码') !== ''){
                alert('密码错误！');
                history.back();
            }
        }
    })();
</script>








<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">






  <script>
  (function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/6f697dad.js","daovoice")
  daovoice('init', {
      app_id: "6f697dad"
    });
  daovoice('update');
  </script>















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="HTML,">





  <link rel="alternate" href="/atom.xml" title="达叔小生" type="application/atom+xml">






<meta name="description" content="用一切抱怨的时间去努力">
<meta name="keywords" content="HTML">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML入门教材">
<meta property="og:url" content="https://huangguangda.github.io/2018/05/17/1/index.html">
<meta property="og:site_name" content="达叔小生">
<meta property="og:description" content="用一切抱怨的时间去努力">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-10-19T12:04:26.438Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="HTML入门教材">
<meta name="twitter:description" content="用一切抱怨的时间去努力">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":true},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://huangguangda.github.io/2018/05/17/1/">




<!-- 网页加载条 -->
<script src="https://neveryu.github.io/js/src/pace.min.js"></script>
  <title>HTML入门教材 | 达叔小生</title>
  









  <!-- 音频播放 -->
<link rel="stylesheet" href="/dist/APlayer.min.css">
<div id="aplayer"></div>
<script type="text/javascript" src="/dist/APlayer.min.js"></script>
<script type="text/javascript" src="/dist/music.js"></script>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <a href="https://github.com/huangguangda" class="github-corner" aria-label="View source on Github"><svg width="80" height="80" viewbox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">达叔小生</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description">爱好分享的码农</h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-首页">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-关于">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-标签">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-分类">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-归档">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-书籍">
          <a href="/books" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br>
            
            书籍
          </a>
        </li>
      
        
        <li class="menu-item menu-item-电影">
          <a href="/movies" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-chrome"></i> <br>
            
            电影
          </a>
        </li>
      
        
        <li class="menu-item menu-item-站点">
          <a href="/sitemap.xml" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>
            
            站点
          </a>
        </li>
      
        
        <li class="menu-item menu-item-公益">
          <a href="/404/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-heartbeat"></i> <br>
            
            公益
          </a>
        </li>
      
        
        <li class="menu-item menu-item-课本">
          <a href="/book/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-apple"></i> <br>
            
            课本
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off" placeholder="搜索..." spellcheck="false" type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>


 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://huangguangda.github.io/2018/05/17/1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="达叔小生">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="达叔小生">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">HTML入门教材</h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-05-17T11:48:02+08:00">
                2018-05-17
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/HTML/" itemprop="url" rel="index">
                    <span itemprop="name">HTML</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv">本文总阅读量
            <span class="busuanzi-value" id="busuanzi_value_page_pv"></span>次
            </span>
          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计&#58;</span>
                
                <span title="字数统计">
                  0
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长 &asymp;</span>
                
                <span title="阅读时长">
                  1
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <blockquote class="blockquote-center">用一切抱怨的时间去努力</blockquote>

<a id="more"></a>
<h2 id="HTML-基本结构及实体"><a href="#HTML-基本结构及实体" class="headerlink" title="HTML 基本结构及实体"></a>HTML 基本结构及实体</h2><ul>
<li>了解 HTML 文档的基本结构</li>
<li>掌握 HTML 结构标签<html><head><title><body></body></title></head></html></li>
<li>掌握 HTML 字符实体</li>
</ul>
<h2 id="HTML"><a href="#HTML" class="headerlink" title="HTML"></a>HTML</h2><h4 id="HTML-文件是什么？"><a href="#HTML-文件是什么？" class="headerlink" title="HTML 文件是什么？"></a>HTML 文件是什么？</h4><p>HTML 表示超文本标记语言（Hyper Text Markup Language）。<br>HTML 文件是一个包含标记的文本文件。<br>这些标记保证浏览器怎样显示这个页面。<br>HTML 文件必须有 htm 或者 html 扩展名。<br>HTML 文件可以用一个简单的文本编辑器创建。</p>
<h4 id="想不想尝试一下？"><a href="#想不想尝试一下？" class="headerlink" title="想不想尝试一下？"></a>想不想尝试一下？</h4><p>假如你运行的是 windows 系统，打开记事本，在其中输入以下文本：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">&lt;title&gt;Title of page&lt;/title&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">This is my first homepage.</span><br><span class="line">&lt;b&gt;This text is bold&lt;/b&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<p>将此文件保存为“mypage.htm”。</p>
<h4 id="例子解释"><a href="#例子解释" class="headerlink" title="例子解释:"></a>例子解释:</h4><p>HTML 文档中，第一个标签是<html>。</html></p>
<p>这个标签告诉浏览器这是 HTML 文档的开始。</p>
<p>HTML</p>
<p>文档的最后一个标签是，这个标签告诉浏览器这是 HTML 文档的终止。</p>
<p>在<head>和</head>标签之间文本的是头信息。</p>
<p>在浏览器窗口中，头信息是不被显示的 。</p>
<p>在<title>和</title>标签之间的文本是文档标题，它被显示在浏览器窗口的标题栏 。</p>
<p>在<body>和</body>标签之间的文本是正文，会被显示在浏览器中。</p>
<p>在<b>和</b>标签之间的文本会以加粗字体显示。</p>
<h4 id="关于-HTML-编辑器："><a href="#关于-HTML-编辑器：" class="headerlink" title="关于 HTML 编辑器："></a>关于 HTML 编辑器：</h4><p>用一些所见即所得的编辑器，比如 frontpage，dreamwaver，你可以很容易创建一个<br>页面，而不需要在纯文本中编写代码。</p>
<p>但是假如你想成为一名熟练的网络开发者，我们强烈推荐你用纯文本编辑器编写代码 ，<br>这有助于学习 HTML 基础。</p>
<h4 id="常见问题"><a href="#常见问题" class="headerlink" title="常见问题:"></a>常见问题:</h4><p>问：我编写完了 HTML 文件，但是不能在浏览器中看见结果，为什么？</p>
<p>答 ： 请确 认 你 保 存了 文 件 ， 并且 使 用 了 正确 的 文 件 名和 扩 展 名 ，例 如 ：<br>“c:\mypage.htm”，并且确认你用浏览器打开时使用同样的文件名。</p>
<p>问：我编辑了 HTML 文件，但是修改结果并没有在浏览器中显示，为什么？</p>
<p>答：浏览器缓存了你的页面，所以它不需要两次读取同样的页面。你修改了这个页面 ，<br>浏览器并不知道。请使用“刷新/重载”按钮来强迫浏览器读取编辑过的页面。</p>
<h4 id="HTML-元素："><a href="#HTML-元素：" class="headerlink" title="HTML 元素："></a>HTML 元素：</h4><p>HTML 文档是由 HTML 元素组成的文本文件。</p>
<p>HTML 元素是预定义的正在使用的 HTML 标签。</p>
<h5 id="HTML-标签："><a href="#HTML-标签：" class="headerlink" title="HTML 标签："></a>HTML 标签：</h5><p>HTML 标签用来组成 HTML 元素。</p>
<p>HTML 标签两端有两个包括字符：“&lt;”和“&gt;”,这两个包括字符被称为角括号。</p>
<p>HTML 标签通常成对出现，比如<b>和</b>。</p>
<p>一对标签的前面一个是开始标签，第二个是结束标签,在开始和结束标签之间的文本是元素内容。</p>
<p>HTML 标签是大小写无关的，<b>跟<b>表示的意思是一样的。</b></b></p>
<h5 id="HTML-元素：-1"><a href="#HTML-元素：-1" class="headerlink" title="HTML 元素："></a>HTML 元素：</h5><p>回忆一下上面的 HTML 例子：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">&lt;head&gt;</span><br><span class="line">&lt;title&gt;Title of page&lt;/title&gt;</span><br><span class="line">&lt;/head&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">This is my first homepage.</span><br><span class="line">&lt;b&gt;This text is bold&lt;/b&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure></p>
<p>下面是一个 HTML 元素：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;b&gt;This text is bold&lt;/b&gt;</span><br></pre></td></tr></table></figure></p>
<p>此 HTML 元素以开始标签<b>起始， 内容是：This text is bold，以结束标签</b>中止 。</p>
<p><b>标签的目的是定义一个需要被显示成粗体的 HTML 元素。</b></p>
<p>下面也是一个 HTML 元素：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;body&gt;</span><br><span class="line">This is my first homepage.</span><br><span class="line">&lt;b&gt;This text is bold&lt;/b&gt;</span><br><span class="line">&lt;/body&gt;</span><br></pre></td></tr></table></figure></p>
<p>此 HTML 标签以开始标签<body>起始，终止于结束标签<script src="/live2dw/lib/L2Dwidget.min.js?0c58a1486de42ac6cc1c59c7d98ae887"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"live2d-widget-model-hibiki"},"display":{"position":"right","width":75,"height":150},"mobile":{"show":false},"log":false});</script></body>。</p>
<p><body>标签的目的</body></p>
<p>是定义一个 HTML 元素，使其包含 HTML 文档的主体。</p>
<p>为什么使用小写标签？</p>
<p>我们刚说过，HTML 标签是大小写无关的：</p>
<p><b>跟<b>含义相同。</b></b></p>
<p>当你上网的时候，你会注意到多数教程在示例中使用大写的 HTML 标签，我们总是使用小写标签。</p>
<p>为什么？</p>
<p>假如你想投入到下一代 HTML 中，你应该开始使用小写标签。</p>
<p>W3C 在他们的 HTML4建议中提倡使用小写标签，XHTML（下一代 HTML）也需要小写标签。</p>
<h5 id="标签属性："><a href="#标签属性：" class="headerlink" title="标签属性："></a>标签属性：</h5><p>标签可以拥有属性。</p>
<p>属性能够为页面上的 HTML 元素提供附加信息。</p>
<p>标签<body>定义了 HTML 页面的主体元素。</body></p>
<p>使用一个附加的 bgcolor 属性，你可以告诉浏览器：你页面的背景色是红色的，就像这样：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;body bgcolor=&quot;red&quot;&gt;</span><br></pre></td></tr></table></figure></p>
<p>标签<table>定义了一个 HTML 表格。</table></p>
<p>使用一个附加的 border 属性，你可以告诉浏览器：这个表格是没有边框的，代码是：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;table border=&quot;0&quot;&gt;</span><br></pre></td></tr></table></figure></p>
<p>属性通常由属性名和值成对出现，就像这样：name=”value”。</p>
<p>属性通常是附加给 HTML元素的开始标签的。</p>
<h4 id="引号样式："><a href="#引号样式：" class="headerlink" title="引号样式："></a>引号样式：</h4><p>属性值应该被包含在引号中。<br>双引号是最常用的，但是单引号也可以使用。</p>
<p>在很少情况下，比如说属性值本身包含引号，使用单引号就很必要了。</p>
<blockquote>
<p>比如：name=’John “ShotGun” Nelson’。</p>
</blockquote>
<p>注意：中文引号跟英文引号是不一样的。<br>上面所指的引号都是英文状态下的引号。</p>
<h4 id="HTML-实体"><a href="#HTML-实体" class="headerlink" title="HTML  实体"></a>HTML  实体</h4><p>有些字符，比如说“&lt;”字符，在 HTML 中有特殊的含义，因此不能在文本中使用。<br>想要在 HTML 中显示一个小于号“&lt;”，需要用到字符实体。</p>
<h5 id="字符实体："><a href="#字符实体：" class="headerlink" title="字符实体："></a>字符实体：</h5><p>在 HTML 中，有些字符拥有特殊含义，比如小于号“&lt;”定义为一个 HTML 标签的开始 。</p>
<p>假如我们想要浏览器显示这些字符的话，必须在 HTML 代码中插入字符实体。</p>
<p>一个字符实体拥有三个部分：<br>一个 and 符号（&amp;），<br>一个实体名或者一个实体号，<br>最后是一个分号（;）</p>
<p>想要在 HTML 文档中显示一个小于号，我们必须这样写：&lt;或者&#60;</p>
<p>使用名字相对于使用数字的优点是容易记忆，缺点是并非所有的浏览器都支持最新的实体名，但是几乎所有的浏览器都能很好地支持实体号。</p>
<p>注意：实体名是大小写敏感的。</p>
<p>下面这个例子能够让你针对 HTML 实体实践一下。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;p&gt;This is a character entity: &amp;#123;&lt;/p&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure></p>
<h4 id="不可拆分的空格"><a href="#不可拆分的空格" class="headerlink" title="不可拆分的空格"></a>不可拆分的空格</h4><p>在 HTML 中，最常见的字符实体就是不可拆分空格。</p>
<p>通常，HTML 会合并你文档中的空格。<br>假如在你的 HTML 文本中连续写了 10 个空格 ，其中 9 个会被去掉。<br>想要在 HTML 中插入空格，可以使用实体：&nbsp;</p>
<h2 id="HTML-基本元素的运用"><a href="#HTML-基本元素的运用" class="headerlink" title="HTML  基本元素的运用"></a>HTML  基本元素的运用</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">段落相关标签&lt;p&gt;&lt;br&gt;&lt;hr&gt;</span><br><span class="line">格式化相关标签&lt;small&gt;&lt;sub&gt;&lt;sup&gt;&lt;pre&gt;</span><br><span class="line">列表相关标签&lt;ol&gt;&lt;ul&gt;&lt;li&gt;</span><br><span class="line">图片相关标签&lt;img&gt;</span><br><span class="line">超链相关标签&lt;a&gt;</span><br></pre></td></tr></table></figure>
<h3 id="段落-相关-标签"><a href="#段落-相关-标签" class="headerlink" title="段落 相关 标签"></a>段落 相关 标签</h3><p>标题元素：<br>标题元素由标签</p><h1>到<h6>定义。<h1>定义了最大的标题元素，<h6>定义了最小的。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;h1&gt;This is a heading&lt;/h1&gt;</span><br><span class="line">&lt;h2&gt;This is a heading&lt;/h2&gt;</span><br><span class="line">&lt;h3&gt;This is a heading&lt;/h3&gt;</span><br><span class="line">&lt;h4&gt;This is a heading&lt;/h4&gt;</span><br><span class="line">&lt;h5&gt;This is a heading&lt;/h5&gt;</span><br><span class="line">&lt;h6&gt;This is a heading&lt;/h6&gt;</span><br></pre></td></tr></table></figure></h6></h1></h6></h1><p></p>
<blockquote>
<p>HTML 自动在一个标题元素前后各添加一个空行。</p>
</blockquote>
<h4 id="段落："><a href="#段落：" class="headerlink" title="段落："></a>段落：</h4><p>段落是用</p><p>标签定义的。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;p&gt;This is another paragraph&lt;/p&gt;</span><br></pre></td></tr></table></figure></p>
<blockquote>
<p>HTML 自动在一个段落前后各添加一个空行。</p>
</blockquote>
<h4 id="换行："><a href="#换行：" class="headerlink" title="换行："></a>换行：</h4><p>当需要结束一行，并且不想开始新段落时，使用<br>标签。<br>标签不管放在什么位置，都能够强制换行。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&lt;p&gt;This &lt;br&gt; is a para&lt;br&gt;graph with line breaks&lt;/p&gt;</span><br></pre></td></tr></table></figure></p>
<blockquote>
<p><br>标签是一个空标签，它没有结束标记。</p>
</blockquote>
<h4 id="格式化-相关-标签"><a href="#格式化-相关-标签" class="headerlink" title="格式化 相关 标签"></a>格式化 相关 标签</h4><p>格式化文字：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;body&gt;</span><br><span class="line">		&lt;b&gt;This text is bold&lt;/b&gt;&lt;br&gt;</span><br><span class="line">		&lt;strong&gt;</span><br><span class="line">		This text is strong</span><br><span class="line">		&lt;/strong&gt;&lt;br&gt;</span><br><span class="line">		&lt;big&gt;</span><br><span class="line">		This text is big</span><br><span class="line">		&lt;/big&gt;&lt;br&gt;</span><br><span class="line">		&lt;em&gt;</span><br><span class="line">		This text is emphasized</span><br><span class="line">		&lt;/em&gt;&lt;br&gt;</span><br><span class="line">		&lt;i&gt;</span><br><span class="line">		This text is italic</span><br><span class="line">		&lt;/i&gt;&lt;br&gt;</span><br><span class="line">		&lt;small&gt;</span><br><span class="line">		This text is small</span><br><span class="line">		&lt;/small&gt;&lt;br&gt;</span><br><span class="line">		This text contains</span><br><span class="line">		&lt;sub&gt;</span><br><span class="line">		subscript</span><br><span class="line">		&lt;/sub&gt;&lt;br&gt;</span><br><span class="line">		This text contains</span><br><span class="line">		&lt;sup&gt;</span><br><span class="line">		superscript</span><br><span class="line">		&lt;/sup&gt;</span><br><span class="line">	&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure></p>
<h3 id="列表相关标签"><a href="#列表相关标签" class="headerlink" title="列表相关标签"></a>列表相关标签</h3><h4 id="无序列表："><a href="#无序列表：" class="headerlink" title="无序列表："></a>无序列表：</h4><p>无序列表是一个项目的序列。各项目前加有标记（通常是黑色的实心小圆圈）。</p>
<p>无序列表以<ul>标签开始。每个列表项目以<li>开始。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;ul&gt;</span><br><span class="line">&lt;li&gt;Coffee&lt;/li&gt;</span><br><span class="line">&lt;li&gt;Milk&lt;/li&gt;</span><br><span class="line">&lt;/ul&gt;</span><br></pre></td></tr></table></figure></li></ul></p>
<p>无序列表的项目中可以加入段落、换行、图像，链接，其他的列表等等。</p>
<h4 id="有序列表："><a href="#有序列表：" class="headerlink" title="有序列表："></a>有序列表：</h4><p>有序列表也是一个项目的序列。各项目前加有数字作标记。</p>
<p>有序列表以<ol>标签开始。每个列表项目以<li>开始。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&lt;ol&gt;</span><br><span class="line">Web程序开发基础</span><br><span class="line">12</span><br><span class="line">&lt;li&gt;Coffee&lt;/li&gt;</span><br><span class="line">&lt;li&gt;Milk&lt;/li&gt;</span><br><span class="line">&lt;/ol&gt;</span><br></pre></td></tr></table></figure></li></ol></p>
<h2 id="不同类型："><a href="#不同类型：" class="headerlink" title="不同类型："></a>不同类型：</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">&lt;ol type=&quot;A&quot;&gt;</span><br><span class="line">&lt;ol type=&quot;a&quot;&gt;</span><br><span class="line">&lt;ol type=&quot;I&quot;&gt;</span><br><span class="line">&lt;ol type=&quot;i&quot;&gt;</span><br><span class="line"></span><br><span class="line">&lt;ul type=&quot;disc&quot;&gt;</span><br><span class="line">&lt;ul type=&quot;circle&quot;&gt;</span><br><span class="line">&lt;ul type=&quot;square&quot;&gt;</span><br></pre></td></tr></table></figure>
<h2 id="图片相关标签"><a href="#图片相关标签" class="headerlink" title="图片相关标签"></a>图片相关标签</h2><h4 id="Img-标签和-src属性："><a href="#Img-标签和-src属性：" class="headerlink" title="Img 标签和 src属性："></a>Img 标签和 src属性：</h4><p>在 HTML 里面，图像是由<img>标签定义的。</p>
<p><img>是空标签，意思是说，它只拥有属性，而没有结束标签。</p>
<p>想要在页面上显示一个图像，需要使用 src属性。<br>“src”表示“源”的意思。“src”属性的值是所要显示图像的 URL。</p>
<h5 id="插入图像的语法："><a href="#插入图像的语法：" class="headerlink" title="插入图像的语法："></a>插入图像的语法：</h5><p>URL 指向图像存储的地址。</p>
<p>alt 属性：</p>
<p>alt 属性用来给图像显示一个“交互文本”。<br>alt 属性的值是由用户定义的。</p>
<p>“alt”属性在浏览器装载图像失败的时候告诉用户所丢失的信息，此时，浏览器显示这个“交互文本”来代替图像。给页面上的图像都加上 alt 属性是一个好习惯，它有助于更好地显示信息，而且，对纯文本浏览器很有用。</p>
<h5 id="基本注意点——有用的技巧"><a href="#基本注意点——有用的技巧" class="headerlink" title="基本注意点——有用的技巧:"></a>基本注意点——有用的技巧:</h5><p>如果一个 HTML 文档包含 10 个图像，那么为了正确显示这个页面，需要加载 11 个文件 。<br>加载图像是需要时间的，所以请谨慎使用图像。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;img src=&quot;./images/hackanm.gif&quot; width=&quot;20&quot; height=&quot;20&quot;&gt;</span><br><span class="line"></span><br><span class="line">&lt;body background=&quot;./images/background.jpg&quot;&gt;</span><br><span class="line"></span><br><span class="line">&lt;a href=&quot;back.htm&quot;&gt;</span><br><span class="line">&lt;img border=&quot;0&quot; src=&quot;./images/next.gif&quot;&gt;</span><br><span class="line">&lt;/a&gt;</span><br></pre></td></tr></table></figure>
<h2 id="超链相关标签"><a href="#超链相关标签" class="headerlink" title="超链相关标签"></a>超链相关标签</h2><h3 id="锚标签和-href-属性："><a href="#锚标签和-href-属性：" class="headerlink" title="锚标签和 href 属性："></a>锚标签和 href 属性：</h3><p>HTML 使用锚标签（<a>）来创建一个连接到其他文件的链接。<br>锚可以指向网络上的任何资源：HTML 页面，图像，声音，影片等等。</a></p>
<p>标签<a>被用来创建一个链接指向的锚，href 属性用来指定连接到的地址，在锚的起始标签<a>和结束标签</a>中间的部分将被显示为超级链接。</a></p>
<h4 id="target-属性："><a href="#target-属性：" class="headerlink" title="target 属性："></a>target 属性：</h4><p>使用 target 属性，你可以定义从什么地方打开链接地址。</p>
<h4 id="锚标签和-name-属性"><a href="#锚标签和-name-属性" class="headerlink" title="锚标签和 name 属性"></a>锚标签和 name 属性</h4><p>name 属性用来创建一个命名的锚。使用命名锚以后，可以让链接直接跳转到一个页面的某一章节，而不用用户打开那一页，再从上到下慢慢找。</p>
<p>下面是命名锚的语法：</p>
<p>你可以为锚随意指定名字，只要你愿意。</p>
<h4 id="基本注意点——有用的技巧："><a href="#基本注意点——有用的技巧：" class="headerlink" title="基本注意点——有用的技巧："></a>基本注意点——有用的技巧：</h4><p>命名锚通常用来在大型文档的开头创建章节表。这个页面的每个章节被加上一个命名锚，到这些锚的链接被放在页面的顶端。</p>
<p>如果浏览器无法找到指定的命名锚，它将转到这个页面的顶部，而不显示任何错误提示。</p>
<h4 id="更多示例："><a href="#更多示例：" class="headerlink" title="更多示例："></a>更多示例：</h4><p>在新浏览器窗口中打开链接：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;a href=&quot;lastpage.htm&quot; target=&quot;_blank&quot;&gt;Last Page&lt;/a&gt;</span><br><span class="line">&lt;p&gt;</span><br><span class="line">If you set the target attribute of a link to &quot;_blank&quot;,</span><br><span class="line">the link will open in a new window.</span><br><span class="line">&lt;/p&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure></p>
<h2 id="用-HTML-创建表格"><a href="#用-HTML-创建表格" class="headerlink" title="用 HTML  创建表格"></a>用 HTML  创建表格</h2><ul>
<li><p>了解掌握表格的基本结构<table><tr><th></th><td></td></tr></table></p>
</li>
<li><p>掌握跨行、跨列属性 colspan rowspan</p>
</li>
<li><p>掌 握 表 格 相 关 修 饰 属 性 border width height bgcolor</p>
</li>
<li><p>background height cellpadding cellspacing</p>
</li>
</ul>
<h2 id="HTML-表格"><a href="#HTML-表格" class="headerlink" title="HTML  表格"></a>HTML  表格</h2><p>表格 :</p>
<p>表格是用<table>标签定义的。</table></p>
<p>表格被划分为行（使用<tr>标签），每行又被划分为数据单</tr></p>
<p>元格（使用<td>标签）。td 表示“表格数据”（ Table Data），即数据单元格的内容。</td></p>
<h4 id="数据单元格可以包含文本，图像，列表，段落，表单，水平线，表格等等。想不想尝试一下？"><a href="#数据单元格可以包含文本，图像，列表，段落，表单，水平线，表格等等。想不想尝试一下？" class="headerlink" title="数据单元格可以包含文本，图像，列表，段落，表单，水平线，表格等等。想不想尝试一下？"></a>数据单元格可以包含文本，图像，列表，段落，表单，水平线，表格等等。想不想尝试一下？</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">&lt;table border=&quot;1&quot;&gt;</span><br><span class="line"> &lt;tr&gt;</span><br><span class="line">  &lt;td&gt;&lt;/td&gt;</span><br><span class="line"> &lt;/tr&gt;</span><br><span class="line">&lt;/table&gt;</span><br><span class="line"></span><br><span class="line">&lt;table&gt;</span><br><span class="line">	&lt;caption&gt;table title and/or explanatory text&lt;/caption&gt;</span><br><span class="line">	&lt;thead&gt;</span><br><span class="line">		&lt;tr&gt;</span><br><span class="line">			&lt;th&gt;header&lt;/th&gt;</span><br><span class="line">		&lt;/tr&gt;</span><br><span class="line">	&lt;/thead&gt;</span><br><span class="line">	&lt;tbody&gt;</span><br><span class="line">		&lt;tr&gt;</span><br><span class="line">			&lt;td&gt;data&lt;/td&gt;</span><br><span class="line">		&lt;/tr&gt;</span><br><span class="line">	&lt;/tbody&gt;</span><br><span class="line">&lt;/table&gt;</span><br><span class="line"></span><br><span class="line">&lt;table border=&quot;1&gt;</span><br><span class="line"> &lt;tr&gt;</span><br><span class="line">  &lt;th colspan=&quot;&quot; rowspan=&quot;&quot; headers=&quot;&quot; scope=&quot;&quot;&gt;&lt;/th&gt;</span><br><span class="line"> &lt;/tr&gt;</span><br><span class="line"> &lt;tr&gt;</span><br><span class="line">  &lt;td&gt;&lt;/td&gt;</span><br><span class="line"> &lt;/td&gt;</span><br><span class="line">&lt;/table&gt;</span><br><span class="line"></span><br><span class="line">&lt;table border=&quot;1&quot;&gt;</span><br><span class="line"> &lt;tr&gt;</span><br><span class="line">  &lt;td&gt;&lt;/td&gt;</span><br><span class="line"> &lt;/tr&gt;</span><br><span class="line"> &lt;tr&gt;</span><br><span class="line">  &lt;td&gt;&lt;/td&gt;</span><br><span class="line"> &lt;/tr&gt;</span><br><span class="line">&lt;/table&gt;</span><br></pre></td></tr></table></figure>
<h2 id="基本注意点——有用的技巧-1"><a href="#基本注意点——有用的技巧-1" class="headerlink" title="基本注意点——有用的技巧"></a>基本注意点——有用的技巧</h2><p>通常很少使用<thead>，<tbody>，<tfoot>标签，因为浏览器对它们的支持不好。希望这<br>个在 XHTML 的未来版本中得到改变。</tfoot></tbody></thead></p>
<blockquote>
<p>cellpadding 属性在表格内容和边框之间留出更多空白<br>cellspacing 属性来增加单元格间距<br>使用“align”属性来设置单元格的对齐方式</p>
</blockquote>
<h2 id="HTML-表单页面的运用"><a href="#HTML-表单页面的运用" class="headerlink" title="HTML  表单页面的运用"></a>HTML  表单页面的运用</h2><p>掌握表单基本结构<form><br>掌握各种表单元素<br>能理解 post 和 get 两种提交方式的区别</form></p>
<h2 id="HTML-表单"><a href="#HTML-表单" class="headerlink" title="HTML  表单"></a>HTML  表单</h2><p>表单：<br>表单是一个能够包含表单元素的区域。</p>
<p>表单元素是能够让用户在表单中输入信息的元素（比如文本框，密码框，下拉菜单，单<br>选框，复选框等等）。</p>
<h2 id="Input："><a href="#Input：" class="headerlink" title="Input："></a>Input：</h2><p>最常用的表单标签是<input>标签。Input 的类型用 type属性指定。最常用的 input 类型解释如下：</p>
<p>文本框：在表单中，文本框用来让用户输入字母、数字等等。</p>
<p>表单的 action 属性和提交按钮：<br>当用户点击提交按钮的时候，表单的内容会被提交到其他文件。</p>
<p>表单的 action 属性定义了所要提交到的目的文件，该目的文件收到信息后通常进行相关的处理。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;form name=&quot;input&quot; action=&quot;xxxx&quot; method=&quot;get&quot;&gt;</span><br><span class="line"> &lt;input type=&quot;&quot; name=&quot;&quot;&gt;</span><br><span class="line">&lt;/form&gt;</span><br></pre></td></tr></table></figure>
<p>简单的下拉列表：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;body&gt;</span><br><span class="line">		&lt;form&gt;</span><br><span class="line">			&lt;select name=&quot;cars&quot;&gt;</span><br><span class="line">				&lt;option value=&quot;volvo&quot;&gt;Volvo</span><br><span class="line">				&lt;option value=&quot;saab&quot;&gt;Saab</span><br><span class="line">				&lt;option value=&quot;fiat&quot;&gt;Fiat</span><br><span class="line">				&lt;option value=&quot;audi&quot;&gt;Audi</span><br><span class="line">			&lt;/select&gt;</span><br><span class="line">		&lt;/form&gt;</span><br><span class="line">	&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<p>创建一个含有预先选定元素的下拉列表。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">文本域：</span><br><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;body&gt;</span><br><span class="line">		&lt;p&gt;</span><br><span class="line">		 This example demonstrates a text-area.</span><br><span class="line">		&lt;/p&gt;</span><br><span class="line">		&lt;textarea rows=&quot;10&quot; cols=&quot;30&quot;&gt;</span><br><span class="line">		 The cat was playing in the garden.</span><br><span class="line">		&lt;/textarea&gt;</span><br><span class="line">	&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;body&gt;</span><br><span class="line">		&lt;form&gt;</span><br><span class="line">		&lt;input type=&quot;button&quot; value=&quot;Hello world!&quot;&gt;</span><br><span class="line">		&lt;/form&gt;</span><br><span class="line">	&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;body&gt;</span><br><span class="line">		&lt;fieldset&gt;</span><br><span class="line">			&lt;legend&gt;</span><br><span class="line">			 Health information:</span><br><span class="line">			&lt;/legend&gt;</span><br><span class="line">			&lt;form&gt;</span><br><span class="line">		     Height&lt;input type=&quot;text&quot; size=&quot;3&quot;&gt;</span><br><span class="line">			 Weight&lt;input type=&quot;text&quot; size=&quot;3&quot;&gt;</span><br><span class="line">			&lt;/form&gt;</span><br><span class="line">		&lt;/fieldset&gt;</span><br><span class="line">		&lt;p&gt;</span><br><span class="line">		 If there is no border around the input form, your browser is too old.</span><br><span class="line">		&lt;/p&gt;</span><br><span class="line">	&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">	&lt;body&gt;</span><br><span class="line">		&lt;form action=&quot;x&quot; method=&quot;post&quot;</span><br><span class="line">		enctype=&quot;text/plain&quot;&gt;</span><br><span class="line">			&lt;h3&gt;xxxxxxxxxxx&lt;/h3&gt;</span><br><span class="line">			 Name:&lt;br&gt;</span><br><span class="line">			&lt;input type=&quot;text&quot; name=&quot;name&quot; value=&quot;yourname&quot; size=&quot;20&quot;&gt;</span><br><span class="line">			 &lt;br&gt;</span><br><span class="line">			 Mail:&lt;br&gt;</span><br><span class="line">			&lt;input type=&quot;text&quot; name=&quot;mail&quot; value=&quot;yourmail&quot; size=&quot;20&quot;&gt;</span><br><span class="line">			&lt;br&gt;</span><br><span class="line">			 Comment:&lt;br&gt;</span><br><span class="line">			&lt;input type=&quot;text&quot; name=&quot;comment&quot; value=&quot;yourcomment&quot; size=&quot;40&quot;&gt;</span><br><span class="line">			 &lt;br&gt;&lt;br&gt;</span><br><span class="line">			&lt;input type=&quot;submit&quot; value=&quot;Send&quot;&gt;</span><br><span class="line">			&lt;input type=&quot;reset&quot; value=&quot;Reset&quot;&gt;</span><br><span class="line">		&lt;/form&gt;</span><br><span class="line">	&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<h2 id="使用样式表美化页面-1-1"><a href="#使用样式表美化页面-1-1" class="headerlink" title="使用样式表美化页面 1 1"></a>使用样式表美化页面 1 1</h2><p>掌握在网页中使用 CSS 的方法<br>熟悉 CSS 的不同选择器的使用方法<br>熟悉字体属性：font-family，font-size，font-style，<br>font-weight<br>熟悉文本属性：text-align，text-indent，text-decoration，<br>text-transform，vertical-align，word-spacing，<br>letter-spacing</p>
<h2 id="CSS-的工作原理"><a href="#CSS-的工作原理" class="headerlink" title="CSS  的工作原理"></a>CSS  的工作原理</h2><p>在这一节，你将学习如何制作自己的第一个样式表。</p>
<p>你将了解基本的 CSS 模型，以及在HTML 文档里使用 CSS 所必需的代码。</p>
<p>级联样式表（CSS）里用到的许多 CSS 属性都与 HTML 属性相似，所以，假如你熟悉<br>采用 HTML 进行布局的话，那么这里的许多代码你都不会感到陌生。我们先来看一个具<br>体的例子。</p>
<h2 id="基本的-CSS-语法："><a href="#基本的-CSS-语法：" class="headerlink" title="基本的 CSS 语法："></a>基本的 CSS 语法：</h2><p>比方说，我们要用红色作为网页的背景色：<br>用  L HTML 的话，我们可以这样：<br>用  CSS的话，我们可以这样获得同样的效果：</p>
<h4 id="为一个-HTML-文档应用-CSS："><a href="#为一个-HTML-文档应用-CSS：" class="headerlink" title="为一个 HTML 文档应用 CSS："></a>为一个 HTML 文档应用 CSS：</h4><p>为 HTML 文档应用 CSS，有三种方法可供选择。</p>
<p>下面对这三种方法进行了概括。我们建议你对第三种方法（即外部样式表）予以关注。</p>
<p>方法 1：行内样式表（style 属性）</p>
<p>方法 2：内部样式表（style 元素）</p>
<p>方法 3：外部样式表（引用一个样式表文件）</p>
<h2 id="元素的分类与标识（-class-和-和-id-）"><a href="#元素的分类与标识（-class-和-和-id-）" class="headerlink" title="元素的分类与标识（ class  和 和  id ）"></a>元素的分类与标识（ class  和 和  id ）</h2><p>有时，你希望对特定元素或者特定一组元素应用特殊的样式。<br>在这一节，我们将深入学习如何利用 class 和 id 来为所选元素指定属性。</p>
<p>如何实现为网站上许多标题中的某一个单独应用颜色？<br>如何实现把网站上的链接分为不同的类，并对各类链接分别应用不同的样式？<br>这只是本节将解决的诸多问题中的最具代表性的两个问题。</p>
<h2 id="字体属性"><a href="#字体属性" class="headerlink" title="字体属性"></a>字体属性</h2><p>这一节，你将学习字体以及如何用 CSS 来设置字体。我们还会考虑如何解决“网站所选<br>的字体仅当访问者的 PC 上安装有该字体时才会被显示”这一难题。本节将对下列 CSS<br>属性进行讲解：</p>
<p>• font-family<br>• font-style<br>• font-variant<br>• font-weight<br>• font-size<br>• font</p>
<h4 id="字体族-font-family-："><a href="#字体族-font-family-：" class="headerlink" title="字体族[font-family]："></a>字体族[font-family]：</h4><p>CSS 属性 font-family 的作用是设置一组按优先级排序的字体列表，如果该列表中的<br>第一个字体未在访问者计算机上安装，那么就尝试列表中的下一个字体，依此类推，直<br>到列表中的某个字体是已安装的。</p>
<p>有两种类型的名称可用于分类字体：字体族名称（family-name）和族类名称（generic<br>family）。下面来解释这两个术语。</p>
<p>字体族名称（family-name）：</p>
<p>字体族名称（就是我们通常所说的“字体”）的例子包括<br>“Arial”、“Times New Roman” 、“宋体”、“黑体”等等。</p>
<p>字体样式[font-style]：<br>CSS 属性 font-style 定义所选字体的显示样式： normal （正常）、 c italic （斜体）或  oblique<br>（倾斜）。</p>
<p>字体变化[font-variant]：<br>CSS 属性 font-variant 的值可以是： normal（正常）或  s small-caps（小体大写字母） 。<br>small-caps 字体是一种以小尺寸显示的大写字母来代替小写字母的字体。</p>
<p>字体浓淡[font-weight]：<br>CSS 属性 font-weight 指定字体显示的浓淡程度。其值可以是  l normal（正常）或  bold<br>（加粗）。</p>
<p>字体大小[font-size]：<br>字体的大小用 CSS 属性 font-size 来设置。字体大小可通过多种不同单位（比如像素或百分比等）来设置。</p>
<h2 id="文本-属性"><a href="#文本-属性" class="headerlink" title="文本 属性"></a>文本 属性</h2><p>文本的显示格式与式样对于网页设计师来说是一个重要问题。<br>这一节将向你介绍 CSS 在文本布局方面令人激动的特性。本节将对下列 CSS 属性进行讲解：</p>
<p>• text-indent<br>• text-align<br>• text-decoration<br>• letter-spacing<br>• text-transform</p>
<p>文本缩进[text-indent]：<br>CSS 属性 text-indent 用于为段落设置首行缩进，以令其具有美观的格式。</p>
<p>文本对齐[text-align]：<br>CSS 属性 text-align 与 HTML 属性 align 的功能相同。该属性的值可以是：<br>left（左对齐）、 right（右对齐）或者  center（居中）。</p>
<p>文本装饰[text-decoration]：<br>CSS 属性 text-decoration 令我们可以为文本增添不同的“装饰”或“效果”。</p>
<p>字符间距[letter-spacing]：<br>CSS 属性 letter-spacing 用于设置文本的水平字间距。</p>
<p>文本转换[text-transform]：<br>CSS 属性 text-transform 用于控制文本的大小写。<br>无论字母本来的大小写，你可以通过该属性令它<br>首字母大写（capitalize）、全部大写（uppercase）或者全部小写（lowercase）。</p>
<h2 id="使用样式表美化页面"><a href="#使用样式表美化页面" class="headerlink" title="使用样式表美化页面"></a>使用样式表美化页面</h2><p>熟悉显示属性：display<br>熟悉边框属性：Border , border-style 等<br>熟悉定位属性：top , Width , Height , Left</p>
<h4 id="显示-属性"><a href="#显示-属性" class="headerlink" title="显示 属性"></a>显示 属性</h4><p>显示属性允许使用四个值中的一个来定义一个元素：<br>block ：在元素的前和后都会有换行<br>inline ：在元素的前和后都不会有换行<br>list-item ：与 block 相同，但增加了目录项标记<br>none ：没有显示</p>
<h2 id="边框-属性"><a href="#边框-属性" class="headerlink" title="边框 属性"></a>边框 属性</h2><p>边框（border）可以有多种用途，比如作为装饰元素或者作为划分两物的分界线。在设<br>置边框方面，CSS 为你提供了无尽选择。</p>
<p>• border-width<br>• border-color<br>• border-style</p>
<h2 id="边框宽度-border-width-："><a href="#边框宽度-border-width-：" class="headerlink" title="边框宽度[border-width]："></a>边框宽度[border-width]：</h2><p>边框宽度由 CSS 属性 border-width 定义，其值可以是“thin”（薄）、“medium”（普通 ）<br>或“thick”（厚）等，也可以是像素值。</p>
<h2 id="边框颜色-border-color-："><a href="#边框颜色-border-color-：" class="headerlink" title="边框颜色[border-color]："></a>边框颜色[border-color]：</h2><p>CSS 属性 border-color 用于定义边框的颜色。其值就是正常的颜色值，例如：“#123456”、<br>“rgb(123,123,123)”、“yellow”等。</p>
<h2 id="边框样式-border-style-："><a href="#边框样式-border-style-：" class="headerlink" title="边框样式[border-style]："></a>边框样式[border-style]：</h2><p>边框样式有多种可供选择。</p>
<h2 id="缩写-border-："><a href="#缩写-border-：" class="headerlink" title="缩写[border]："></a>缩写[border]：</h2><p>跟许多其他属性一样，你也可以将有关边框的 CSS 属性缩写为一个 border 属性。</p>
<h2 id="相对定位："><a href="#相对定位：" class="headerlink" title="相对定位："></a>相对定位：</h2><p>要对元素进行相对定位，应将 position 属性的值设为relative。<br>绝对定位与相对定位的区别在于计算位置的方式。</p>
<p>采用相对定位的元素，其位置是相对于它在文档中的原始位置计算而来的。<br>这意味着 ，相对定位是通过将元素从原来的位置向右、向左、向上或向下移动来定位的。<br>采用相对定位的元素会获得相应的空间。</p>
<h2 id="HTML-中框架、层的运用"><a href="#HTML-中框架、层的运用" class="headerlink" title="HTML  中框架、层的运用"></a>HTML  中框架、层的运用</h2><p>掌握框架结构<frameset><frame><iframe><br>掌握组织元素：span 和 div</iframe></frameset></p>
<h2 id="框架"><a href="#框架" class="headerlink" title="框架"></a>框架</h2><p>使用框架，可以在一个浏览器窗口中显示不止一个 HTML 文档。<br>这样的 HTML 文档被称为框架页面，它们是相互独立的。：</p>
<p>使用框架的不利因素有：</p>
<p>• 网站开发者需要关心更多 HTML 文档的情况。<br>• 打印整个页面变得困难。</p>
<p>frameset 标签：</p>
<p>• <frameset>标签定义了如何将窗口拆分成框架。<br>• 每个 frameset 标签定义了一组行和列。<br>• 行/列的值指明了每个行/列在屏幕上所占的大小</frameset></p>
<p>frame标签：</p>
<p>• <frame>标签定义了每个框架中放入什么文件。</p>
<p>基本注意点——有用的技巧：</p>
<p>假如一个框架有可见边框，用户可以拖动边框来改变它的大小。<br>如果不想让用户改变大小，可以在<frame>标签中加入：noresize=”noresize”。<br>给不支持框架的浏览器写上<noframes>标签。</noframes></p>
<h2 id="内联框架："><a href="#内联框架：" class="headerlink" title="内联框架："></a>内联框架：</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;html&gt;</span><br><span class="line">&lt;body&gt;</span><br><span class="line">&lt;iframe src=&quot;intro.htm&quot;&gt;&lt;/iframe&gt;</span><br><span class="line">&lt;p&gt;Some older browsers don&apos;t support iframes.&lt;/p&gt;</span><br><span class="line">&lt;p&gt;If they don&apos;t, the iframe will not be visible.&lt;/p&gt;</span><br><span class="line">&lt;/body&gt;</span><br><span class="line">&lt;/html&gt;</span><br></pre></td></tr></table></figure>
<h2 id="组织元素-：-span-和-和-div"><a href="#组织元素-：-span-和-和-div" class="headerlink" title="组织元素 ： span  和 和  div"></a>组织元素 ： span  和 和  div</h2><p>span 和 div 元素用于组织和结构化文档，并经常联合 class 和 id 属性一起使用。</p>
<p>用 span 组织元素：</p>
<p>span 元素可以说是一种中性元素，因为它不对文档本身添加任何东西。<br>但是与 CSS 结合使用的话，span 可以对文档中的部分文本增添视觉效果。</p>
<h2 id="XML-基本知识"><a href="#XML-基本知识" class="headerlink" title="XML  基本知识"></a>XML  基本知识</h2><p>XML  的应用范围<br>人类一直在不断地尝试改进自己的发明，其中也包括人类最伟大的发明——文字的构成。<br>第一个文本处理系统是用纸笔记录文字。现在，计算机文本处理器已经取代了手工处理，它不仅包含原始文档，还负责设置格式、出版和管理。在这些方便的功能整合到字处理之前，是由排字工人遵循书面标记说明来完成所有格式编排的。<br>正是利益于这种实践，人们将“标记”这个词加入到 HTML 和 XML。顾名思义，标记是指加上记号。<br>文本处理环境（如 XML）中使用了相同的标记过程。</p>
<p>使用脚本语言或 DHTML 能够以各种方式显示信息。<br>这就要求必须为相同的输出编写不同的代码以供不同的浏览器使用，因为这些语言不能跨浏览器兼容。</p>
<p>XML（eXtensible Markup Language，可扩展标记语言）克服了这些缺点。<br>顾名思义，XM L是可扩展的，即开发人员可以定义自己的一组标签，并使其他的人或程序能够理解这些标签。</p>
<p>HTML 是单标记语言，为特定应用设计，而 XML 则是一系列的标记语言。<br>因此 ，XML 比 HTML 灵活得多。</p>
<p>实际上，由于 XML 标签表示了数据的逻辑结构，不同的应用可以通过不同的方式来解释和使用这些标签。<br>Web 上的数据大多是继承的，XML 继承了 SGML 和 HTML 的优点。<br>也就是说，它不仅继承了 SGML 的特色，还结合了 HTM L的特色。</p>
<p>它采用了 SGML 的主要框架，有时，人们也将 XML 称为 SGML 的子集。<br>因此 ，HTML 是 SGML 的应用，而 XML 是 SGML 的子集。</p>
<p>使用标签对文档进行标记以提供有关内容的信息，不仅能加快搜索速度，而且还能降低网络流量。<br>XML 是由 SGML 修整并改造而来，它是一种元语言，用于描述其他语言。</p>
<p>我们可以使用 XML 为特定目的创建自己的标记语言（如化学标记语言）。</p>
<p>XML 是基于文本的格式，允许开发人员描述结构化数据并在各种应用之间发送和交换这些数据，这样客户端就可以显示并自定义数据。</p>
<p>XML 还有助于在服务器之间传输结构化数据。</p>
<p>有许多信息是分布在不同的和不匹配的数据库中。</p>
<p>如有必要，XML 允许通过使用自定义格式来标识、交换和处理这些数据库可以理解的数据。</p>
<p>XML 和 HTML 有许多相同点和不同点。XML描述数据，如城市名称、温度和气压；HTML定义描述数据显示方式的标签，如使用项目符号列表或表格。</p>
<p>但 XML 允许开发人员定义任意数量的标签集，使用开发人员有很大的灵活性来决定要使用哪些数据，并确定数据的适用标准或自定义标签。</p>
<h2 id="L-XML-的-文档-结构"><a href="#L-XML-的-文档-结构" class="headerlink" title="L XML  的 文档 结构"></a>L XML  的 文档 结构</h2><p>XML 文档是由一组使用唯一名称标识的实体组成。</p>
<p>所有文档都以根或文档实体开始，而且所有实体都是可选的。</p>
<p>实体可以被视为更复杂功能的别名。单个实体名称可以代替许多文本。</p>
<p>在别名方案中，每当需要引用某个文本时，只需要使用别名，处理器会展开别名的内容。</p>
<p>XML 文档也有一种逻辑结构。</p>
<p>ok,完</p>
      
    </div>
    
    
    

      <div>
        
          <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>
        
      </div>

    

      <div>
        <div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/images/微信公众号.jpg" alt="达叔小生 wechat" style="width: 200px; max-width: 100%">
    <div>欢迎您扫一扫上面的微信公众号，订阅我的博客！</div>
</div>

      </div>
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center">
  <div>坚持原创技术分享，您的支持将鼓励我继续创作！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.png" alt="达叔小生 微信支付">
        <p>微信支付</p>
      </div>
    

    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者：</strong>
    达叔小生
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://huangguangda.github.io/2018/05/17/1/" title="HTML入门教材">https://huangguangda.github.io/2018/05/17/1/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>
    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处！
  </li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/HTML/" rel="tag"><i class="fa fa-tag"></i> HTML</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/05/16/1/" rel="next" title="必背面试题">
                <i class="fa fa-chevron-left"></i> 必背面试题
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/05/18/1/" rel="prev" title="腾讯智慧校园开发平台1">
                腾讯智慧校园开发平台1 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
        
<script>
  with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];
</script>

      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zNTU5OC8xMjEzNA=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
      <div id="sidebar-dimmer"></div>
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/avatar.gif" alt="达叔小生">
            
              <p class="site-author-name" itemprop="name">达叔小生</p>
              <p class="site-description motion-element" itemprop="description"></p>

            <div id="days"></div>
<script>
function show_date_time(){
window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("04/23/1997 00:00:00");
today=new Date();
timeold=(today.getTime()-BirthDay.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=setzero(Math.floor(e_hrsold));
e_minsold=(e_hrsold-hrsold)*60;
minsold=setzero(Math.floor((e_hrsold-hrsold)*60));
seconds=setzero(Math.floor((e_minsold-minsold)*60));
document.getElementById('days').innerHTML="已运行"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒";
}
function setzero(i){
if (i<10)
{i="0" + i};
return i;
}
show_date_time();
</script>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">94</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">20</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">21</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
                <a title="收藏到书签，偶尔High一下^_^" rel="alternate" class="mw-harlem_shake_slow wobble shake" href="javascript:(function() {
    function c() {
        var e = document.createElement(&quot;link&quot;);
        e.setAttribute(&quot;type&quot;, &quot;text/css&quot;);
        e.setAttribute(&quot;rel&quot;, &quot;stylesheet&quot;);
        e.setAttribute(&quot;href&quot;, f);
        e.setAttribute(&quot;class&quot;, l);
        document.body.appendChild(e)
    }
 
    function h() {
        var e = document.getElementsByClassName(l);
        for (var t = 0; t < e.length; t++) {
            document.body.removeChild(e[t])
        }
    }
 
    function p() {
        var e = document.createElement(&quot;div&quot;);
        e.setAttribute(&quot;class&quot;, a);
        document.body.appendChild(e);
        setTimeout(function() {
            document.body.removeChild(e)
        }, 100)
    }
 
    function d(e) {
        return {
            height : e.offsetHeight,
            width : e.offsetWidth
        }
    }
 
    function v(i) {
        var s = d(i);
        return s.height > e && s.height < n && s.width > t && s.width < r
    }
 
    function m(e) {
        var t = e;
        var n = 0;
        while (!!t) {
            n += t.offsetTop;
            t = t.offsetParent
        }
        return n
    }
 
    function g() {
        var e = document.documentElement;
        if (!!window.innerWidth) {
            return window.innerHeight
        } else if (e && !isNaN(e.clientHeight)) {
            return e.clientHeight
        }
        return 0
    }
 
    function y() {
        if (window.pageYOffset) {
            return window.pageYOffset
        }
        return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
    }
 
    function E(e) {
        var t = m(e);
        return t >= w && t <= b + w
    }
 
    function S() {
        var e = document.createElement(&quot;audio&quot;);
        e.setAttribute(&quot;class&quot;, l);
        e.src = i;
        e.loop = false;
        e.addEventListener(&quot;canplay&quot;, function() {
            setTimeout(function() {
                x(k)
            }, 500);
            setTimeout(function() {
                N();
                p();
                for (var e = 0; e < O.length; e++) {
                    T(O[e])
                }
            }, 15500)
        }, true);
        e.addEventListener(&quot;ended&quot;, function() {
            N();
            h()
        }, true);
        e.innerHTML = &quot; <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>&quot;;
        document.body.appendChild(e);
        e.play()
    }
 
    function x(e) {
        e.className += &quot; &quot; + s + &quot; &quot; + o
    }
 
    function T(e) {
        e.className += &quot; &quot; + s + &quot; &quot; + u[Math.floor(Math.random() * u.length)]
    }
 
    function N() {
        var e = document.getElementsByClassName(s);
        var t = new RegExp(&quot;\\b&quot; + s + &quot;\\b&quot;);
        for (var n = 0; n < e.length; ) {
            e[n].className = e[n].className.replace(t, &quot;&quot;)
        }
    }
 
    var e = 30;
    var t = 30;
    var n = 350;
    var r = 350;
    var i = &quot;//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3&quot;;
    var s = &quot;mw-harlem_shake_me&quot;;
    var o = &quot;im_first&quot;;
    var u = [&quot;im_drunk&quot;, &quot;im_baked&quot;, &quot;im_trippin&quot;, &quot;im_blown&quot;];
    var a = &quot;mw-strobe_light&quot;;
    var f = &quot;//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css&quot;;
    var l = &quot;mw_added_css&quot;;
    var b = g();
    var w = y();
    var C = document.getElementsByTagName(&quot;*&quot;);
    var k = null;
    for (var L = 0; L < C.length; L++) {
        var A = C[L];
        if (v(A)) {
            if (E(A)) {
                k = A;
                break
            }
        }
    }
    if (A === null) {
        console.warn(&quot;Could not find a node of the right size. Please try a different page.&quot;);
        return
    }
    c();
    S();
    var O = [];
    for (var L = 0; L < C.length; L++) {
        var A = C[L];
        if (v(A)) {
            O.push(A)
        }
    }
})()"><i class="fa fa-music"></i> High</a>

            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/huangguangda" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:2397923107@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/c785ece603d1" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-android"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_36232611" target="_blank" title="csdn">
                      
                        <i class="fa fa-fw fa-spinner"></i>csdn</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.douban.com/people/186539024/" target="_blank" title="豆瓣">
                      
                        <i class="fa fa-fw fa-bath"></i>豆瓣</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/da-shu-xiao-sheng/activities" target="_blank" title="知乎">
                      
                        <i class="fa fa-fw fa-globe"></i>知乎</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/5a16e1f3f265da43128096cb" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-google"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5507262458/profile?topnav=1&wvr=6" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzI1NTcxOTQ1Nw==&scene=124#wechat_redirect" target="_blank" title="历史">
                      
                        <i class="fa fa-fw fa-apple"></i>历史</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.cnblogs.com/dashucoding/" target="_blank" title="博客园">
                      
                        <i class="fa fa-fw fa-facebook"></i>博客园</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gdone.gitee.io/englishpages/index.html" target="_blank" title="英文简历">
                      
                        <i class="fa fa-fw fa-globe"></i>英文简历</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gdone.gitee.io/pages/" target="_blank" title="中文简历">
                      
                        <i class="fa fa-fw fa-heartbeat"></i>中文简历</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/GDone/events" target="_blank" title="码云">
                      
                        <i class="fa fa-fw fa-twitter"></i>码云</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://my.oschina.net/xiaomaomi1997/" target="_blank" title="开源中国">
                      
                        <i class="fa fa-fw fa-facebook"></i>开源中国</a>
                  </span>
                
            </div>
          

          
          
            <div class="cc-license motion-element" itemprop="license">
              <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
                <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons">
              </a>
            </div>
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-inline">
              <div class="links-of-blogroll-title">
                <i class="fa fa-fw fa-globe"></i>
                推荐阅读
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.alloyteam.com/nav/" title="Web前端导航" target="_blank">Web前端导航</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.36zhen.com/t?id=3448" title="前端书籍资料" target="_blank">前端书籍资料</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://ife.baidu.com/" title="百度前端技术学院" target="_blank">百度前端技术学院</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://wf.uisdc.com/cn/" title="google前端开发基础" target="_blank">google前端开发基础</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.geekbang.org/" title="极客邦科技" target="_blank">极客邦科技</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://ilxdh.com/" title="龙轩导航" target="_blank">龙轩导航</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://code.giffox.com/" title="程序员导航" target="_blank">程序员导航</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://search.chongbuluo.com/" title="快搜" target="_blank">快搜</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://www.android-doc.com/training/index.html" title="Android中文API" target="_blank">Android中文API</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://developer.android.google.cn/" title="Android Developers" target="_blank">Android Developers</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.freecodecamp.cn/" title="FreeCodeCamp中文社区" target="_blank">FreeCodeCamp中文社区</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://docs.oracle.com/javase/specs/" title="Java SE规范" target="_blank">Java SE规范</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://liuwangshu.cn/" title="刘望舒" target="_blank">刘望舒</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.colabug.com/author/3159ee71c93b3b4a/" title="小楼昨夜又秋风" target="_blank">小楼昨夜又秋风</a>
                  </li>
                
              </ul>

            </div>
          


        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML-基本结构及实体"><span class="nav-number">1.</span> <span class="nav-text">HTML 基本结构及实体</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML"><span class="nav-number">2.</span> <span class="nav-text">HTML</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML-文件是什么？"><span class="nav-number">2.0.1.</span> <span class="nav-text">HTML 文件是什么？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#想不想尝试一下？"><span class="nav-number">2.0.2.</span> <span class="nav-text">想不想尝试一下？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#例子解释"><span class="nav-number">2.0.3.</span> <span class="nav-text">例子解释:</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#关于-HTML-编辑器："><span class="nav-number">2.0.4.</span> <span class="nav-text">关于 HTML 编辑器：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#常见问题"><span class="nav-number">2.0.5.</span> <span class="nav-text">常见问题:</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML-元素："><span class="nav-number">2.0.6.</span> <span class="nav-text">HTML 元素：</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#HTML-标签："><span class="nav-number">2.0.6.1.</span> <span class="nav-text">HTML 标签：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#HTML-元素：-1"><span class="nav-number">2.0.6.2.</span> <span class="nav-text">HTML 元素：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#标签属性："><span class="nav-number">2.0.6.3.</span> <span class="nav-text">标签属性：</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#引号样式："><span class="nav-number">2.0.7.</span> <span class="nav-text">引号样式：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#HTML-实体"><span class="nav-number">2.0.8.</span> <span class="nav-text">HTML  实体</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#字符实体："><span class="nav-number">2.0.8.1.</span> <span class="nav-text">字符实体：</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#不可拆分的空格"><span class="nav-number">2.0.9.</span> <span class="nav-text">不可拆分的空格</span></a></li></ol></li></ol><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML-基本元素的运用"><span class="nav-number">3.</span> <span class="nav-text">HTML  基本元素的运用</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#段落-相关-标签"><span class="nav-number">3.1.</span> <span class="nav-text">段落 相关 标签</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#undefined"><span class="nav-number"></span> <span class="nav-text">到定义。定义了最大的标题元素，定义了最小的。123456&lt;h1&gt;This is a heading&lt;/h1&gt;&lt;h2&gt;This is a heading&lt;/h2&gt;&lt;h3&gt;This is a heading&lt;/h3&gt;&lt;h4&gt;This is a heading&lt;/h4&gt;&lt;h5&gt;This is a heading&lt;/h5&gt;&lt;h6&gt;This is a heading&lt;/h6&gt;</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#undefined"><span class="nav-number">0.0.0.0.1.</span> <span class="nav-text">定义。定义了最大的标题元素，定义了最小的。123456&lt;h1&gt;This is a heading&lt;/h1&gt;&lt;h2&gt;This is a heading&lt;/h2&gt;&lt;h3&gt;This is a heading&lt;/h3&gt;&lt;h4&gt;This is a heading&lt;/h4&gt;&lt;h5&gt;This is a heading&lt;/h5&gt;&lt;h6&gt;This is a heading&lt;/h6&gt;</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#undefined"><span class="nav-number"></span> <span class="nav-text">定义了最大的标题元素，定义了最小的。123456&lt;h1&gt;This is a heading&lt;/h1&gt;&lt;h2&gt;This is a heading&lt;/h2&gt;&lt;h3&gt;This is a heading&lt;/h3&gt;&lt;h4&gt;This is a heading&lt;/h4&gt;&lt;h5&gt;This is a heading&lt;/h5&gt;&lt;h6&gt;This is a heading&lt;/h6&gt;</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#undefined"><span class="nav-number">0.0.0.0.1.</span> <span class="nav-text">定义了最小的。123456&lt;h1&gt;This is a heading&lt;/h1&gt;&lt;h2&gt;This is a heading&lt;/h2&gt;&lt;h3&gt;This is a heading&lt;/h3&gt;&lt;h4&gt;This is a heading&lt;/h4&gt;&lt;h5&gt;This is a heading&lt;/h5&gt;&lt;h6&gt;This is a heading&lt;/h6&gt;</span></a></li></ol></li><li class="nav-item nav-level-4"><a class="nav-link" href="#段落："><span class="nav-number">0.0.1.</span> <span class="nav-text">段落：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#换行："><span class="nav-number">0.0.2.</span> <span class="nav-text">换行：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#格式化-相关-标签"><span class="nav-number">0.0.3.</span> <span class="nav-text">格式化 相关 标签</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#列表相关标签"><span class="nav-number">0.1.</span> <span class="nav-text">列表相关标签</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#无序列表："><span class="nav-number">0.1.1.</span> <span class="nav-text">无序列表：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#有序列表："><span class="nav-number">0.1.2.</span> <span class="nav-text">有序列表：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#不同类型："><span class="nav-number">1.</span> <span class="nav-text">不同类型：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#图片相关标签"><span class="nav-number">2.</span> <span class="nav-text">图片相关标签</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Img-标签和-src属性："><span class="nav-number">2.0.1.</span> <span class="nav-text">Img 标签和 src属性：</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#插入图像的语法："><span class="nav-number">2.0.1.1.</span> <span class="nav-text">插入图像的语法：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#基本注意点——有用的技巧"><span class="nav-number">2.0.1.2.</span> <span class="nav-text">基本注意点——有用的技巧:</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#超链相关标签"><span class="nav-number">3.</span> <span class="nav-text">超链相关标签</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#锚标签和-href-属性："><span class="nav-number">3.1.</span> <span class="nav-text">锚标签和 href 属性：</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#target-属性："><span class="nav-number">3.1.1.</span> <span class="nav-text">target 属性：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#锚标签和-name-属性"><span class="nav-number">3.1.2.</span> <span class="nav-text">锚标签和 name 属性</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#基本注意点——有用的技巧："><span class="nav-number">3.1.3.</span> <span class="nav-text">基本注意点——有用的技巧：</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#更多示例："><span class="nav-number">3.1.4.</span> <span class="nav-text">更多示例：</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#用-HTML-创建表格"><span class="nav-number">4.</span> <span class="nav-text">用 HTML  创建表格</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML-表格"><span class="nav-number">5.</span> <span class="nav-text">HTML  表格</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#数据单元格可以包含文本，图像，列表，段落，表单，水平线，表格等等。想不想尝试一下？"><span class="nav-number">5.0.1.</span> <span class="nav-text">数据单元格可以包含文本，图像，列表，段落，表单，水平线，表格等等。想不想尝试一下？</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#基本注意点——有用的技巧-1"><span class="nav-number">6.</span> <span class="nav-text">基本注意点——有用的技巧</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML-表单页面的运用"><span class="nav-number">7.</span> <span class="nav-text">HTML  表单页面的运用</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML-表单"><span class="nav-number">8.</span> <span class="nav-text">HTML  表单</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Input："><span class="nav-number">9.</span> <span class="nav-text">Input：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#使用样式表美化页面-1-1"><span class="nav-number">10.</span> <span class="nav-text">使用样式表美化页面 1 1</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#CSS-的工作原理"><span class="nav-number">11.</span> <span class="nav-text">CSS  的工作原理</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#基本的-CSS-语法："><span class="nav-number">12.</span> <span class="nav-text">基本的 CSS 语法：</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#为一个-HTML-文档应用-CSS："><span class="nav-number">12.0.1.</span> <span class="nav-text">为一个 HTML 文档应用 CSS：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#元素的分类与标识（-class-和-和-id-）"><span class="nav-number">13.</span> <span class="nav-text">元素的分类与标识（ class  和 和  id ）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#字体属性"><span class="nav-number">14.</span> <span class="nav-text">字体属性</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#字体族-font-family-："><span class="nav-number">14.0.1.</span> <span class="nav-text">字体族[font-family]：</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#文本-属性"><span class="nav-number">15.</span> <span class="nav-text">文本 属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#使用样式表美化页面"><span class="nav-number">16.</span> <span class="nav-text">使用样式表美化页面</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#显示-属性"><span class="nav-number">16.0.1.</span> <span class="nav-text">显示 属性</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#边框-属性"><span class="nav-number">17.</span> <span class="nav-text">边框 属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#边框宽度-border-width-："><span class="nav-number">18.</span> <span class="nav-text">边框宽度[border-width]：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#边框颜色-border-color-："><span class="nav-number">19.</span> <span class="nav-text">边框颜色[border-color]：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#边框样式-border-style-："><span class="nav-number">20.</span> <span class="nav-text">边框样式[border-style]：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#缩写-border-："><span class="nav-number">21.</span> <span class="nav-text">缩写[border]：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#相对定位："><span class="nav-number">22.</span> <span class="nav-text">相对定位：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTML-中框架、层的运用"><span class="nav-number">23.</span> <span class="nav-text">HTML  中框架、层的运用</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#框架"><span class="nav-number">24.</span> <span class="nav-text">框架</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#内联框架："><span class="nav-number">25.</span> <span class="nav-text">内联框架：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#组织元素-：-span-和-和-div"><span class="nav-number">26.</span> <span class="nav-text">组织元素 ： span  和 和  div</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#XML-基本知识"><span class="nav-number">27.</span> <span class="nav-text">XML  基本知识</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#L-XML-的-文档-结构"><span class="nav-number">28.</span> <span class="nav-text">L XML  的 文档 结构</span></a></li></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love" id="heart">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">达叔小生</span>

  
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
    
      <span class="post-meta-item-text">Site words total count&#58;</span>
    
    <span title="Site words total count">357.6k</span>
  
</div>






  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.4</div>




<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">博客全站共357.6k字</span>
</div>

<div class="weixin-box">
  <div class="weixin-menu">
    <div class="weixin-hover">
      <div class="weixin-description">微信扫一扫，订阅本博客</div>
    </div>
  </div>
</div>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user">本站访客数</i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye">本站总访问量</i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      次
    </span>
  
</div>





  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=65809965";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  



  
  









  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  

  
  
    <script type="text/javascript" src="/lib/three/three.min.js"></script>
  

  
  
    <script type="text/javascript" src="/lib/three/three-waves.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
  












  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  


  <script type="text/javascript" src="/lib/clipboard/clipboard.min.js"></script>
<script type="text/javascript" src="/js/src/custom.js"></script>


   <canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none"></canvas> 
   <script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script> 
   <script type="text/javascript" src="/js/src/fireworks.js"></script>


  <!-- 代码块复制功能 -->
  <script type="text/javascript" src="/js/src/clipboard.min.js"></script>  
  <script type="text/javascript" src="/js/src/clipboard-use.js"></script>
<script src="/live2dw/lib/L2Dwidget.min.js?0c58a1486de42ac6cc1c59c7d98ae887"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"live2d-widget-model-hibiki"},"display":{"position":"right","width":75,"height":150},"mobile":{"show":false},"log":false});</script></body>
</html>